IF OBJECT_ID('ssf.ptx_get_active_task_dependency') IS NOT NULL
	DROP FUNCTION ssf.ptx_get_active_task_dependency
GO

CREATE FUNCTION ssf.ptx_get_active_task_dependency (
	@task_group_id INT
)
RETURNS TABLE
AS
/*
<object_header>

<object_summary>
	<purpose><![CDATA[

	]]></purpose>
</object_summary>

</object_header>
*/

	RETURN (
		SELECT *
		FROM ssf.ptx_get_task_dependency(@task_group_id)
		WHERE active_fl = 1
		AND task_id IN (
			SELECT task_id FROM ssf.ptx_get_active_task(@task_group_id)
		)
	)
GO
